package com.github.zzay.common.core.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author zzay
 * @className ResponseBean
 * @description Model class of Response Bean.
 * @create 2022/07/05 15:50
 */
@Data
@NoArgsConstructor
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Hidden
public class ResponseBean<T> {

    /**
     * Status code.
     */
    private Integer code;

    /**
     * Extra information (Hint message / Error message / ...).
     */
    private String msg;

    /**
     * Data field.
     */
    private T data;

    public ResponseBean(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResponseBean(Integer code, T data) {
        this.code = code;
        this.data = data;
    }

    public ResponseBean(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

}
